/**
 * Created by zxl on 2020-03-31.
 */
import Property from './Property.js';
export default class CombotreeProperty extends Property{
    constructor(report){
        super();
        this.col.append(this.buildBindParameter());
        this.positionLabelGroup=this.buildPositionLabelGroup();
        this.col.append(this.positionLabelGroup);
        this.col.append(this.buildLabelGroup());
        this.optionFormGroup=$("<div class='form-group'>");
        this.col.append(this.optionFormGroup);
    }
    refreshValue(editor){
        super.refreshValue(editor);
        this.optionFormGroup.empty();
        const group=$(`<div class="form-group"><label>数据类型</label></div>`);
        const datasourceSelect=$(`<select class="form-control">
            <option value="auditDept">审计单位</option>
            <option value="auditObject">被审计单位</option>
        </select>`);
        group.append(datasourceSelect);
        this.optionFormGroup.append(group);

        datasourceSelect.change(function(){
            editor.dataType = $(this).val();
        });

        if (editor.dataType && editor.dataType!='') {
            datasourceSelect.val(editor.dataType);
        }else{
            datasourceSelect.val('auditDept');
        }
    }
}